package com.springStudy.core.profile.envconfig;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;

@Configuration
@Profile("dev")
@PropertySource(value={"classpath:dev/application.properties"})//要使用绝对路径不能使用 占位符
//@PropertySource(value={"classpath*:dev/*.properties"})
public class ConfigDev {
    @Value("${database.name}")
    private String dbName ;
    @Bean
    public String DBConfig() {
        String db = "一个测试环境数据库对象"+dbName;
        System.out.println(db);
        return db;
    }


}
